package com.mdd.admin.validate.goods;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 服务参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "服务请求对象", description = "服务请求对象")
public class GoodsParam implements Serializable {

	private static final long serialVersionUID = 1L;

	public interface create {
	}

	public interface update {
	}

	public interface delete {
	}

	@NotNull(message = "id参数必传且需大于0", groups = {update.class, delete.class})
	@ApiModelProperty(value = "主键id")
	private Long id;

	@NotNull(message = "name参数缺失", groups = {create.class, update.class})
	@Length(max = 64, message = "name参数不能超出64个字符", groups = {create.class, update.class})
	@ApiModelProperty(value = "服务名称")
	private String name;

	@Length(max = 255, message = "服务简介不能超出255个字符", groups = {create.class, update.class})
	@ApiModelProperty(value = "服务简介")
	private String remarks;

	@NotNull(message = "categoryId参数缺失", groups = {create.class, update.class})
	@DecimalMin(value = "0", message = "categoryId参数值不能少于0", groups = {create.class, update.class})
	@ApiModelProperty(value = "分类id")
	private Long categoryId;

	@NotNull(message = "unitId参数缺失", groups = {create.class, update.class})
	@DecimalMin(value = "0", message = "unitId参数值不能少于0", groups = {create.class, update.class})
	@ApiModelProperty(value = "单位id")
	private Long unitId;

	@NotNull(message = "image参数缺失", groups = {create.class, update.class})
	@ApiModelProperty(value = "服务主图")
	private String image;

	@NotNull(message = "price参数缺失", groups = {create.class, update.class})
	@DecimalMin(value = "0", message = "price参数值不能少于0", groups = {create.class, update.class})
	@ApiModelProperty(value = "价格")
	private BigDecimal price;

	@DecimalMin(value = "0", message = "划线价不能少于0", groups = {create.class, update.class})
	@ApiModelProperty(value = "划线价")
	private BigDecimal scribingPrice;

	@NotNull(message = "status参数缺失", groups = {create.class, update.class})
	@DecimalMin(value = "0", message = "status参数值不能少于0", groups = {create.class, update.class})
	@ApiModelProperty(value = "状态：1-立即上架；0-放入仓库")
	private Integer status;

	@ApiModelProperty(value = "排序")
	@DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
	private Integer sort;

	@ApiModelProperty(value = "服务详情")
	private String content;

	@ApiModelProperty(value = "预约人数")
	private Integer orderNum;

	@ApiModelProperty(value = "服务积分")
	private BigDecimal integral = new BigDecimal(0.0);

	@ApiModelProperty("是否手动派单 0 系统派单 1 手动派单")
	private Integer isManualDispatch;

	@ApiModelProperty("超出数量")
	private Integer outNumber;

	@ApiModelProperty("是否轮播：0-否、1-是")
	private Integer carousel;

	@ApiModelProperty("今日特价的优惠的价格")
	private BigDecimal afterPrice;

	@ApiModelProperty("限时专区服务数量")
	private Integer limitedGoodsNum;

	@ApiModelProperty("限时专区开始时间设置 格式： yyyy-MM-dd HH:mm:ss")
	private String limitedStartTime;

	@ApiModelProperty("限时专区结束时间设置 格式： yyyy-MM-dd HH:mm:ss")
	private String limitedEndTime;

	@ApiModelProperty("是否团购：0-否、1-是")
	private Integer isBuy;

	@ApiModelProperty("团购数量  - 扩展字段")
	private Integer buyNum;

	@ApiModelProperty("团购人数")
	private Integer buyPeopleNum;

	@ApiModelProperty("团购拼团时间")
	private Integer buyStartTime;

	@ApiModelProperty("团购结束时间--没有使用")
	private String buyEndTime;

	@ApiModelProperty("团购价")
	private BigDecimal buyNumber;
}
